﻿using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;

namespace TL_Cloud.ViewModels.BookShop.BKTypeInfo
{
    public class BKTypeInfoAddOrUpdateResourceValidator<T> : AbstractValidator<T>
          where T : BKTypeBasicResource
    {
        public BKTypeInfoAddOrUpdateResourceValidator()
        {
            RuleFor(x => x.BktypeName)
                 .NotNull()
                 .WithName("图书类型")
                 .WithMessage("required|{PropertyName}是必填的")
                 .MaximumLength(50)
                 .WithMessage("maxlength|{PropertyName}的最大长度是{MaxLength}");


        }

    }
}
